<template>
<div style="background: rgb(245,245,245);min-height: 100vh">
  <router-view></router-view>
  <van-tabbar v-model="active" @change="change">
    <van-tabbar-item name="/index" icon="home-o">首页</van-tabbar-item>
    <van-tabbar-item name="/alarm" icon="bulb-o">系统日志</van-tabbar-item>
    <van-tabbar-item name="/set" icon="setting-o">动态监测</van-tabbar-item>
    <van-tabbar-item name="/iot" icon="user-o">云端管理</van-tabbar-item>
  </van-tabbar>
</div>
</template>

<script setup>
import {ref} from 'vue';
import {useRouter,useRoute} from "vue-router";
const router=useRouter();
const route=useRoute();
const active=ref(route.path)
const change=(url)=>{
  router.push(url)
}

</script>

<style scoped>

</style>